package com.wodwl.controller;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.wodwl.dao.ResourceDao;
import com.wodwl.dao.ResourceDao.Mode;
import com.wodwl.entity.Resource;

@Controller
public class TestController {
	@RequestMapping("/test/jquery.do")
	 public String jquery(HttpServletRequest request,HttpServletResponse response) {
		return "/test/jquery";
	}
	@RequestMapping("/test/swf.do")
	 public String swf(HttpServletRequest request,HttpServletResponse response) {
		return "/test/swf";
	}
	@RequestMapping("/test/css.do")
	 public String css(HttpServletRequest request,HttpServletResponse response) {
		return "/test/css";
	}
	@RequestMapping("/test/tab2.do")
	 public String tab2(HttpServletRequest request,HttpServletResponse response) {
		Cookie[] cookies=request.getCookies();
		for(Cookie cookie: cookies){
			System.out.println(cookie.getName()+"==>"+cookie.getValue());
		}
		request.setAttribute("test","wodwl jia");
		return "/test/jquery/tab22";
	}
	@RequestMapping("/test/cookie.do")
	 public String cookie(HttpServletRequest request,HttpServletResponse response) {
		Cookie cookie=new Cookie("cookie1","hello world");
		cookie.setMaxAge(60);
		cookie.setPath("/");
		response.addCookie(cookie);
		return "/test/jquery/tab22";
	}
}
